package com.zhuiYun.project.api.seckill.mapper;

import com.zhuiYun.project.api.seckill.entity.Seckill;
import com.zhuiYun.project.common.mapper.BaseMapper;
import com.zhuiYun.project.common.response.CommonResult;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * @ClassName SeckillMapper
 * @Description TODO
 * Author 高
 * @Date 2023/4/11 10:15
 * @Version 1.0
 **/
@Mapper
public interface SeckillMapper extends BaseMapper<Seckill> {
    @Select("SELECT * FROM seckill s JOIN commodity c ON s.comm_id = c.id ORDER BY s.seckill_price ASC")
    @Results({
            @Result(property = "seckillPrice" , column = "seckill_price"),
            @Result(property = "commodityName" , column = "commodity_name"),
            @Result(property = "seckillEndDate" , column = "seckill_end_date"),
            @Result(property = "seckillStartDate" , column = "seckill_start_date"),
            @Result(property = "imageId" , column = "image_id"),
            @Result(property = "seckillStock" , column = "seckill_stock"),
    })
    List<Seckill> selectSeckillAndCommodity();



}
